package com.bl.student.dao.model;

import com.bl.student.common.enums.InformationType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by liangweikang on 18/1/20.
 */
@Entity
@Data
@Table(name = "INFORMATION")
@ApiModel(value = "InformationEntity", description = "信息")
@DynamicInsert
@DynamicUpdate
public class InformationEntity {
    @Id
    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "封面")
    private String cover;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "简介")
    private String description;

    @ApiModelProperty(value = "标签")
    private String tags;

    @ApiModelProperty(value = "权重")
    private int weight;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "活动类型")
    private InformationType type;

    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @Column(name = "update_time")
    private Date updateTime;

    @ApiModelProperty(value = "详情页id")
    @Column(name = "detail_id")
    private String detailId;

}
